import { selList, getAllProvince,changeStatus, getAllProvinceCity, getDistrictAndStreet, listAllData, add, edit, del, selById, queryAllExportData } from '@/services/taskAllocationApi';

export default {
    namespace: 'taskAllocation',

    state: {

    },

    effects: {
        /**
        * 新增
        * @param payload
        * @param call
        * @param put
        * @returns {Generator<*, *, *>}
        */
        *selList({ payload }, { call, put }) {
            const response = yield call(selList, payload);
            return response;
        },

        /**
     * 获取所有省份
     * */
        *getAllProvince({ payload }, { call, put }) {
            const response = yield call(getAllProvince, payload);
            return response;
        },

        /**
         * 获取所有省份
         * */
        *getAllProvinceCity({ payload }, { call, put }) {
            const response = yield call(getAllProvinceCity, payload);
            return response;
        },

        /**
         * 获取城市下的区街道信息
         * */
        *getDistrictAndStreet({ payload }, { call, put }) {
            const response = yield call(getDistrictAndStreet, payload);
            return response;
        },

        /**
                * 获取机构
                * */
        *listAllData({ payload }, { call, put }) {
            const response = yield call(listAllData, payload);
            return response;
        },


        /**
         * 添加保存
         * */
        *add({ payload }, { call, put }) {
            const response = yield call(add, payload);
            return response;
        },

        /**
         * 编辑保存
         * */
        *edit({ payload }, { call, put }) {
            const response = yield call(edit, payload);
            return response;
        },

        /**
       * 删除
       * */
        *del({ payload }, { call, put }) {
            const response = yield call(del, payload);
            return response;
        },


        /**
         * 详情
        * */
        *selById({ payload }, { call, put }) {
            const response = yield call(selById, payload);
            return response;
        },


        /**
   * 点击导出列表信息
   * @param payload
   * @param call
   * @param put
   * @returns {Generator<*, *, *>}
   */
        *queryAllExportData({ payload }, { call, put }) {
            const response = yield call(queryAllExportData, payload);
            return response;
        },
    },

    *changeStatus({ payload }, { call, put }) {
        const response = yield call(changeStatus, payload);
        return response;
    },



    reducers: {

    },
};

